<template>
  <div class="gis-layout-fullscreen" :class="{ active: isFullscreen }" @click="toggle">
    {{ text }}
  </div>
</template>

<script>
import { useFullscreen } from '@vueuse/core';

export default {
  name: 'gis-layout-fullscreen',
  setup() {
    const { isFullscreen, enter, exit, toggle } = useFullscreen();
    return { isFullscreen, enter, exit, toggle };
  },
  computed: {
    text() {
      return this.isFullscreen ? '显示看板' : '全屏';
    },
  },
};
</script>

<style lang="less">
.gis-layout-fullscreen {
  position: absolute;
  //right: 580px;
  //bottom: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 140px;
  padding: 10px;
  background: url('./assets/nor_bt_quyuchangeboc.png') center center no-repeat;
  background-size: 100% 100%;
  writing-mode: vertical-lr;
  transition: right ease 0.3s;
  cursor: pointer;
  color: #ffffff;
  &.active {
    right: 0;
  }
}
</style>
